package com.dailyblue.java.spring.boot.mvc.mybatis.controller;

import com.dailyblue.java.spring.boot.commons.util.JsonResult;
import com.dailyblue.java.spring.boot.mvc.mybatis.service.SectionService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@RequestMapping("/section")
@Controller
public class SectionController {
    @Resource
    private SectionService sectionService;

    @RequestMapping("/find")
    @ResponseBody
    public JsonResult find() {
        return sectionService.findAllSection();
    }

    @RequestMapping("/id")
    @ResponseBody
    public JsonResult findById(int id) {
        return sectionService.findSectionById(id);
    }
}
